//
//  HelpFeekBackTableViewCell.m
//  OAProject
//
//  Created by yhj on 2017/2/23.
//  Copyright © 2017年 cdnunion. All rights reserved.
//

#import "HelpFeekBackTableViewCell.h"

@interface HelpFeekBackTableViewCell ()

@property(nonatomic,strong)UIView *bgView;

// 标题
@property(nonatomic,strong)UILabel *titleLabel;

// 副标题
@property(nonatomic,strong)UILabel *detailTitleLabel;

@end

@implementation HelpFeekBackTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        // ➡️Cell类型
        self.accessoryType=UITableViewCellAccessoryNone;

        self.titleLabel.font=Font_Number(18);

        self.detailTitleLabel.font=Font_Number(14);

        self.backgroundColor=MAIN_BACK_COLOR;

    }
    return self;
}


// bgView
-(UIView *)bgView
{
    if (!_bgView) {
        _bgView=[UIView new];
        _bgView.backgroundColor=WhiteColor;
        ViewBorderRadius(_bgView,kmargin,1,ClearColor);
        [self.contentView addSubview:_bgView];
        [_bgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.top.mas_equalTo(kmargin);
            make.right.bottom.mas_equalTo(-kmargin);
        }];
    }
    return _bgView;
}


// titleLabel
- (UILabel *)titleLabel
{

    if (!_titleLabel) {
        _titleLabel=[self getLabelWithText:@"Q 如何签到(打卡)?" font:Font_Number(18) textColor:[UIColor blackColor] textAlignment:NSTextAlignmentLeft lineBreakMode:NSLineBreakByCharWrapping numberOfLines:1];
        [self.bgView addSubview:_titleLabel];
        [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(kmargin);
            make.top.mas_equalTo(kmargin);
        }];
    }
    return _titleLabel;
}

// detailTitleLabel
- (UILabel *)detailTitleLabel
{
    if (!_detailTitleLabel) {
        _detailTitleLabel=[self getLabelWithText:@"工作--行政--考勤--签到" font:Font_Number(14) textColor:Color666666 textAlignment:NSTextAlignmentLeft lineBreakMode:NSLineBreakByCharWrapping numberOfLines:1];
        [self.bgView addSubview:_detailTitleLabel];
        [_detailTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(kmargin*3);
            make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(kmargin);
        }];
        
    }
    return _detailTitleLabel;
}

@end
